import 'package:flutter/material.dart';

class InputText extends TextFormField{

  InputText({
     super.key,
     String? labelText,
     super.onChanged,
     super.focusNode,
     super.validator,
     Widget? prefixIcon,
     Color? prefixIconColor,
     super.obscureText,
     super.initialValue,
     super.controller,
     Function(String value)? onEntry
  }) :
      super(
          onFieldSubmitted: onEntry,
          decoration: InputDecoration(
            labelText: labelText,
            prefixIcon: prefixIcon,
            prefixIconColor: prefixIconColor ?? Colors.grey,
            labelStyle: const TextStyle(color: Colors.grey),
            focusedBorder: const OutlineInputBorder(
              borderRadius: BorderRadius.all(Radius.circular(10)),
              borderSide:BorderSide(color:Colors.green),
            ),
            enabledBorder: const OutlineInputBorder(
              borderRadius: BorderRadius.all(Radius.circular(10)),
              borderSide: BorderSide(color: Colors.green), // 设置焦点之外的边框颜色
            ),
            border: const OutlineInputBorder(
              borderRadius: BorderRadius.all(Radius.circular(10)),
              borderSide: BorderSide(color: Colors.green), // 设置焦点之外的边框颜色
            ),
            errorStyle: const TextStyle(fontSize: 16)
          )
      );
}